;(function  () {
	var myObject=function  () {
		var loadEvent=function  () {
			var intDiff = parseInt(86399);//倒计时总秒数量
        function timer(intDiff){
            window.setInterval(function(){
            var day=0,
                hour=0,
                minute=0,
                second=0;//时间默认值       
            if(intDiff > 0){
                day = Math.floor(intDiff / (60 * 60 * 24));
                hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
                minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
                second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
            }else{//当时间耗尽，刷新页面
                window.location.reload();
            }
            if (minute <= 9) minute = '0' + minute;
            if (second <= 9) second = '0' + second;

            $(".cd-time").html(hour+':'+minute+':'+second);
            intDiff--;

            }, 1000);

        } 
        $(function(){
            timer(intDiff);
        });
			

		$(".payment-tab-0").click(function(){
       // $("#J_nav_tabs a").removeClass("cur");
        //$(this).addClass("cur");
  	 $(".payment-1").attr("class","payment payment-0");
		$(".payment-list-0").show();
		$(".payment-list-1").hide();
	});
		
		$(".payment-tab-1").click(function  () {
		$(".payment-0").attr("class","payment payment-1");
		$(".payment-list-0").hide();
		$(".payment-list-1").show();
		})
		
		
		$(function () {
			$(".payment-back").click(function () {
				history.go(-2);
			})
		})
		
		$(function () {
			$(".payment-submit").click(function () {
				var val = $(".btn").attr("id");
				var money = $(".block-right .amount .amount-price").text();
				var str = "index?gpid="+val+"&"+money;
				window.location.replace(str);
			})
		})
		
		
		}
		return{
			init:function  () {
				loadEvent();
			}
		}
	}();
	myObject.init();
})(jQuery);
